{% extends "base.html" %}
{% import "/sideview/macros.html" as sideview %}

{% block title %}主要经理{% endblock title %}

{% block content %}
<section>
    <h2>新成员 {{ new_members|length }}枪列表</h2>
    <div class="local_desc02 local_desc">
        成员总数 {{ total_member_count|number_format }}点击阻塞 {{ intercept_count|number_format }}姓名, 撤回 : {{ leave_count|number_format }}姓名
    </div>

    <div class="tbl_head01 tbl_wrap">
        <table>
            <caption>新成员</caption>
            <thead>
                <tr>
                    <th scope="col">会员Id</th>
                    <th scope="col">姓名</th>
                    <th scope="col">昵称</th>
                    <th scope="col">权利</th>
                    <th scope="col">点</th>
                    <th scope="col">收货</th>
                    <th scope="col">公共</th>
                    <th scope="col">认证</th>
                    <th scope="col">阻塞</th>
                    <th scope="col">组</th>
                </tr>
            </thead>
            <tbody>
            {% for member in new_members %}
                {% set group_count = member.groups|length %}
                <tr>
                    <td class="td_mbid">{{ member.mb_id }}</td>
                    <td class="td_mbname">{{ member.mb_name }}</td>
                    <td class="td_mbname sv_use">
                        <div>{{ sideview.get(request, member.mb_id, member.mb_nick, member.mb_email, member.mb_homepage)|safe }}</div>
                    </td>
                    <td class="td_num">{{ member.mb_level }}</td>
                    <td><a href="/admin/point_list?sfl=mb_id&stx={{ member.mb_id }}">{{ member.mb_point|number_format }}</a></td>
                    <td class="td_boolean">{{ '是' if member.mb_mailling else '没有。' }}</td>
                    <td class="td_boolean">{{ '是' if member.mb_open else '没有。' }}</td>
                    <td class="td_boolean">{{ '是' if member.mb_email_certify.year > 2000 else '没有。' }}</td>
                    <td class="td_boolean">{{ '是' if member.mb_intercept_date else '没有。' }}</td>
                    <td class="td_category">
                        {% if group_count > 0 %}
                            <a href="/admin/boardgroupmember_form/{{ member.mb_id }}">{{ group_count|number_format }}</a>
                        {% endif %}
                    </td>
                </tr>
            {% else %}
                <tr>
                    <td colspan="10" class="empty_table">没有材料.</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

    <div class="btn_list03 btn_list">
        <a href="/admin/member_list">成员的完整视图</a>
    </div>

</section>


<section>
    <h2>最近的帖子</h2>

    <div class="tbl_head01 tbl_wrap">
        <table>
            <caption>最近的帖子</caption>
            <thead>
                <tr>
                    <th scope="col">组</th>
                    <th scope="col">公告板</th>
                    <th scope="col">标题</th>
                    <th scope="col">姓名</th>
                    <th scope="col">临时</th>
                </tr>
            </thead>
            <tbody>
                {% for row in new_writes %}
                <tr>
                    <td class="td_category">
                        <a href="/bbs/new?gr_id={{ row.gr_id }}">{{ row.gr_subject|truncate(10) }}</a>
                    </td>
                    <td class="td_category">
                        <a href="/board/{{ row.bo_table }}">{{ row.bo_subject|truncate(20) }}</a>
                    </td>
                    <td>
                        <a href="{{ row.link }}">{{ row.subject|striptags|truncate(100) }}</a>
                    </td>
                    <td class="td_mbname">
                        <div>
                            {% if row.write %}
                            {{ sideview.get(request, row.mb_id, row.name, row.write.wr_email, row.write.wr_homepage)|safe }}
                            {% endif %}
                        </div>
                    </td>
                    <td class="td_datetime">
                        {{ row.datetime }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

    <div class="btn_list03 btn_list">
        <a href="/bbs/new">更多最近的帖子</a>
    </div>
</section>

<section>
    <h2>最近点不出现</h2>
    <div class="local_desc02 local_desc">
        已满 {{ total_point_count|number_format }}干燥 {{ new_points|length }}枪列表
    </div>

    <div class="tbl_head01 tbl_wrap">
        <table>
            <caption>最近点不出现</caption>
            <thead>
                <tr>
                    <th scope="col">会员Id</th>
                    <th scope="col">姓名</th>
                    <th scope="col">昵称</th>
                    <th scope="col">临时</th>
                    <th scope="col">点内容</th>
                    <th scope="col">点</th>
                    <th scope="col">点总和</th>
                </tr>
            </thead>
            <tbody>
            {% for row in new_points %}
                <tr>
                    <td class="td_mbid"><a href="/admin/point_list?sfl=mb_id&stx={{ row.mb_id }}">{{ row.mb_id }}</a></td>
                    <td class="td_mbname">{{ row.member.mb_name }}</td>
                    <td class="td_name sv_use">
                        <div>{{ sideview.get(request, row.member.mb_id, row.member.mb_nick, row.member.mb_email, row.member.mb_homepage)|safe }}</div>
                    </td>
                    <td class="td_datetime">{{ row.po_datetime.strftime('%Y-%m-%d') }}</td>
                    <td><a href="{{ row.link }}">{{ row.po_content }}</a></td>
                    <td class="td_numbig">{{ row.po_point|number_format }}</td>
                    <td class="td_numbig">{{ row.po_mb_point|number_format }}</td>
                </tr>
            {% else %}
                <tr>
                    <td colspan="7" class="empty_table">没有材料.</td>
                    <td colspan="7" class="empty_table">没有材料.</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

    <div class="btn_list03 btn_list">
        <a href="/admin/point_list">积分历史的完整视图</a>
    </div>
</section>
{% endblock content %}